package com.demo.springBootDemo06.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.demo.springBootDemo06.entity.Dept;

@Mapper
public interface DeptMapper {
//	@Select("select deptno,dname,loc from dept where 1=1")
	List<Dept> findList();

//	@Select("select deptno,dname,loc from dept where deptno=#{deptno}")
	Dept getByPrimaryKey(@Param("deptno") Integer deptno);

//	@Insert("insert into dept(deptno,dname,loc) values (#{deptno},#{dname},#{loc})")
	int addDept(Dept dept);

//	@Update("update dept set dname=#{dept.dname},loc=#{dept.loc} where deptno=#{deptno}")
	int updateDept(@Param("deptno") Integer deptno, @Param("dept") Dept dept);

//	@Delete("delete from dept where deptno=#{deptno}")
	int deleteByPrimaryKey(@Param("deptno") Integer deptno);

}
